package com.sy.simpleegg.serialport.whmandroid.util

import com.sy.simpleegg.serialport.whmandroid.status.WhmAndroidMotorStatus
import com.sy.simpleegg.serialport.whmandroid.status.WhmAndroidSnStatus

object WhmAndroidStatusUtil {

    fun getMotorStatus(code: Int): WhmAndroidMotorStatus {
        for (ms in WhmAndroidMotorStatus.entries){
            if (ms.code == code){
                return ms
            }
        }
        return WhmAndroidMotorStatus.INACTIVE
    }

    fun getSnStatus(code: Int): WhmAndroidSnStatus {
        for (ss in WhmAndroidSnStatus.entries){
            if (ss.code == code){
                return ss
            }
        }
        return WhmAndroidSnStatus.SHIPPING_COMPLETED
    }

}